ContextCapture User Guide

Resource data

The header's resources collection describes all the resources needed to complete the definition of the entire set of nodes contained by the 3MXB file. For each resource, the data is organized as follows:

The resource ID is used to link nodes and resources together. For example, the ID is used to attach the geometry to the correct node, and to link the geometry to the corresponding texture.

Four types of resources are possible:

  • textureBuffer, where the texture is included in the 3MXB file.
  • geometryBuffer, that describes a mesh as a binary buffer in the 3MXB file.
  • textureFile, where the texture is an external file.
  • geometryFile, where the mesh is an external file.

For the buffer types, the binary data is included after the header, in one of the buffer objects. The buffers appear in the same relative order in the resource collection and in the buffer collection.

  1. textureBuffer

    The texture buffer JSON data is organized as follows:

    {
    	"type":"textureBuffer", 
    "id": "tex0",
    	"format": "jpg",
    	"size":1513, 
    	}
    

    The " id" identifies the texture in a unique way in the file, but the id is not unique over the entire tree structure.

    The "format" tag indicates the type of the texture image. The image in a texture buffer is saved as a binary buffer in the 3MXB file. The size of the binary data is indicated by the "size" value.

  2. geometryBuffer

    The geometry buffer metadata is:

    {
    	"type":"geometryBuffer", 
    "id": "geometry1",
    	"format": "ctm",
    	"size":835,
    	"bbMin": [-1243.69,-314.572,52.6138],
    	"bbMax": [1243.69,314.572,52.6138],
    	"texture": "tex0"
    	}
    

    The "id" identifies the geometry in a unique way in the file, but the id is not unique over the entire tree structure.

    The "texture"tag is optional, and it appears only if the geometry has a texture. In this case, the texture is identified by its ID. In the example above, the geometry uses the "tex0" texture defined in the "Texture buffer" section.

    The "bbMin" and "bbMax" values describe the geometry's bounding box, in the same way as in the node data.

  3. textureFile

    The texture file JSON description is very similar to the texture buffer, except that instead of the size of a buffer, it indicates the path to an external file containing the image.

    {
    "type":"textureFile", 
    	"format": "jpg",
    "id": "tex1",
    "file": "subfolder/SomeTexture.jpg",
    	}
    
  4. geometryFile

    Like the texture file, the geometry file JSON contains the "file" tag, which points to an external geometry file.

    {
    "type":"geometryFile", 
    	"format": "obj",
    "id": "geometry1",
    "file": "subfolder/SomeMesh.obj",
    "texture": "tex1"
    	}